package com.swjd.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.swjd.po.Customer;
import com.swjd.service.CustomerService;

@Controller
public class CustomerController {
	@Autowired
	private CustomerService customerService;

	/*
	 * 根据id查询客户信息
	 */
	@RequestMapping("/find")
	public String find() {
		return "find";
	}

	@RequestMapping("/findCustomerById")
	public String findCustomerById(Integer id, Model model) {
		Customer customer = customerService.findCustomerById(id);
		model.addAttribute("customer", customer);
		return "customer";
	}
}
